package com.ruoyi.develop.goodsSaledo.service;

import java.util.List;
import java.util.Map;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.develop.goodsSaledo.domain.GoodsSaledo;
import com.ruoyi.develop.lvDo.domain.LvDo;
import com.ruoyi.develop.orderIronRecord.domain.OrderIronRecord;
import com.ruoyi.develop.projectBaseInfo.domain.ProjectBaseInfo;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * 请购单（自制/采购/外协）Service接口
 * @author qh
 * @date 2024-08-09
 */
public interface IGoodsSaledoService {
    /**
     * 查询请购单（自制/采购/外协）
     * @param id 请购单（自制/采购/外协）主键
     * @return 请购单（自制/采购/外协）
     */
    public GoodsSaledo selectById(String id);

    public GoodsSaledo listGoodsOrderInById(String id);

    public void subSuccess(String lvDoId);

    public void subSuccessToCaigou(String lvDoId);

    public void updateLvdo(LvDo entity);
    public void updateLvdoIron(LvDo entity);

    /**
     * 查询请购单（自制/采购/外协）列表
     * @param entity 请购单（自制/采购/外协）
     * @return 请购单（自制/采购/外协）集合
     */
    public List<GoodsSaledo> selectList(GoodsSaledo entity);
    public List<GoodsSaledo> listBuyRemainNotZero(GoodsSaledo entity);

    public List<GoodsSaledo> listQinggou(GoodsSaledo entity);
    public List<GoodsSaledo> listQinggouIsDo(GoodsSaledo entity);
    public List<GoodsSaledo> listQinggouAll(GoodsSaledo entity);

    public List<GoodsSaledo> listSuoding(GoodsSaledo entity);

    public List<GoodsSaledo> listQinggouByBuyallId(GoodsSaledo entity);
    /**
     * 新增请购单（自制/采购/外协）
     * @param entity 请购单（自制/采购/外协）
     * @return 结果
     */
    public int insert(GoodsSaledo entity);

    public void submitScalado(GoodsSaledo entity);

    public void insertDoByLvdo(GoodsSaledo entity);

    public void insertDoByLvdoBohui(GoodsSaledo entity);
    /**
     * 修改请购单（自制/采购/外协）
     * @param entity 请购单（自制/采购/外协）
     * @return 结果
     */
    public int update(GoodsSaledo entity);

    public int editAndGoodsSale(GoodsSaledo entity);

    public int updateJishu(GoodsSaledo entity);
    /**
     * 批量删除请购单（自制/采购/外协）
     * @param ids 需要删除的请购单（自制/采购/外协）主键集合
     * @return 结果
     */
    public int deleteByIds(String[] ids);
    public int deleteTwiceBuyGoodsByIds(String[] ids);

    public int deleteByGoodsSaleId(String id);

    public int isNotDo(String id);

    public int isDo(String id);


    /**
     * 删除请购单（自制/采购/外协）信息
     * @param id 请购单（自制/采购/外协）主键
     * @return 结果
     */
    public int deleteById(String id);

    public String insertBatch(GoodsSaledo goodsSaledo);
    public List<GoodsSaledo> listByProjectId(GoodsSaledo entity);

    //其他产品新增请购记录
    @Transactional
    void insertFromGoodsSale(GoodsSaledo goodsSaledo);

    public void insertBatchLvDo(LvDo entity);

    public void submitLvdoToCg(LvDo entity);
    public void submitLvdoToTech(LvDo entity);
    public void submitLvdoToBuyDept(LvDo entity);

    public void insertBatchDo(GoodsSaledo entity);
    int deletSaleInfoForPrj(String id);
    public void insertBatchNew(GoodsSaledo goodsSaledo,ProjectBaseInfo projectBaseInfo);
    public void insertBatchNewToCaigou(GoodsSaledo goodsSaledo,ProjectBaseInfo projectBaseInfo);

    public int updateStatusByMainId(String status,String mainId);

    public int updateStatusByMainIdCaigou(String status,String mainId);

    void exportData(HttpServletRequest request, HttpServletResponse response, GoodsSaledo entity);

    void exportDataByPleaseBuy(HttpServletRequest request, HttpServletResponse response, GoodsSaledo entity);
    void exportByPleaseBuyIds(HttpServletRequest request, HttpServletResponse response, GoodsSaledo entity);

    void pleaseBuyForMaterial(GoodsSaledo entity, OrderIronRecord orderIronRecord);

    public Map<String,Object> importCaigouData(GoodsSaledo entity, MultipartFile file);

    public Map<String,Object> importCaigouCailiao(GoodsSaledo entity, MultipartFile file);

    void insertBatchIron(LvDo entity);
    void updateBatchIron(LvDo entity);

    List<GoodsSaledo> listGoods(GoodsSaledo entity);

    List<GoodsSaledo> selectBySaleId(String goodsSaleId);

    void insertPleaseBuyForIron(GoodsSaledo entity);



    List<GoodsSaledo> selectListMerge(GoodsSaledo entity);

    void insertForOrderMerge(GoodsSaledo goodsSaledo,List<ProjectBaseInfo> projectBaseInfoList);


    void insertForOrderMergeToCaigou(GoodsSaledo goodsSaledo, List<ProjectBaseInfo> projectBaseInfoList);

    void pleaseBuyForTwiceToTech(LvDo entity);
    void pleaseBuyForTwiceToBuy(LvDo entity);
}
